package com.wcl.demo.view.viewpageanimation;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.wcl.demo.R;

/**
 * @Function: 自定义对话框
 * @Date: 2013-10-28
 * @Time: 下午12:37:43
 * @author Tom.Cai
 */
public class CustomNewTitle extends Dialog {
    private EditText editText;
    private Button positiveButton, negativeButton;
    private TextView title;



    public CustomNewTitle(Context context) {
        super(context, R.style.Dialog);
       // this.editText = editText;
        setCustomDialog();
    }
    //    public CustomNewTitle(Context context) {
//        super(context,R.style.CustomDialog);
//        setCustomDialog();
//    }

    private void setCustomDialog() {
        View mView = LayoutInflater.from(getContext()).inflate(R.layout.dialog_newtitle_layout, null);
        title = (TextView) mView.findViewById(R.id.newtitle_title);
        editText = (EditText) mView.findViewById(R.id.newtitle_number);
        positiveButton = (Button) mView.findViewById(R.id.newtitle_positiveButton);
        negativeButton = (Button) mView.findViewById(R.id.newtitle_negativeButton);
        super.setContentView(mView);
    }

    public View getEditText(){
        return editText;
    }

    @Override
    public void setContentView(int layoutResID) {
    }

    @Override
    public void setContentView(View view, LayoutParams params) {
    }

    @Override
    public void setContentView(View view) {
    }

    /**
     * 确定键监听器
     * @param listener
     */
    public void setOnPositiveListener(View.OnClickListener listener){
        positiveButton.setOnClickListener(listener);
    }
    /**
     * 取消键监听器
     * @param listener
     */
    public void setOnNegativeListener(View.OnClickListener listener){
        negativeButton.setOnClickListener(listener);
    }
}